package cn.exrick.xboot.modules.content.service.mybatis;

import cn.exrick.xboot.modules.content.entity.HontRole;
import cn.exrick.xboot.modules.content.entity.HontUserRole;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;


@CacheConfig(cacheNames = "hontUserRole")
public interface IHontUserRoleService extends IService<HontUserRole> {

    /**
     * 通过用户id获取
     * @param userId
     * @return
     */
    @Cacheable(key = "#userId")
    List<HontRole> findByUserId(@Param("userId") String userId);

    /**
     * 通过用户id获取用户角色关联的部门数据
     * @param userId
     * @return
     */
    List<String> findDepIdsByUserId(String userId);
    List<String> findRoleIdByhontUserId();
}
